<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateScheduleRemindSwitchTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('schedule_remind_switch', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('userId')->default(0)->comment('用户ID');
            $table->unsignedTinyInteger('type')->default(0)->comment('类型 1-排班提醒 2-上班提醒');
            $table->unsignedTinyInteger('switch')->default(0)->comment('默认0-关闭 1-打开');

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->tinyInteger('isDeleted')->comment(0);
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '排班提醒开关';

            $table->index('userId', 'idx_userId');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('schedule_remind_switch');
    }
}
